package cn.masterj.springcloud.service;

import cn.masterj.springcloud.service.fallback.FeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author masterJ
 * @create 2020-04-18 13:37
 */
@Service
//@FeignClient(value = "cloudalibaba-provider-payment",fallback = PaymentFallbackService.class)
@FeignClient(value = "cloudalibaba-provider-payment", fallbackFactory = FeignFallbackFactory.class)
public interface IPaymentSentielService {

    @GetMapping("/testA")
    String testA();

    /**
     * 如果有参数，就需要在参数上加上@RequestParam注解，否则会出现异常: feign.FeignException$MethodNotAllowed: status 405 reading IPaymentSentielService#testB
     * @param id
     * @return
     */
    @GetMapping("/testB")
    String testB(@RequestParam("id") Long id);

}
